import { createRouter, RouteRecordRaw, createWebHistory } from 'vue-router'
const routes: Array<RouteRecordRaw> = [
  // 重定向
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    // 懒加载路由
    component: () => import('@renderer/view/index.vue'),
    children: [
      {
        path: '',
        name: '推荐',
        component: () => import('@renderer/view/home/home.vue')
      },
      // 专辑/歌单列表
      {
        name: '专辑/歌单',
        path: '/detail',
        component: () => import('@renderer/view/detail/detail.vue')
      },
      // 乐馆
      {
        path: '/musicHall',
        name: '乐馆',
        component: () => import('@renderer/view/musicHall/musicHall.vue')
      },
      // 视频
      {
        path: '/video',
        name: '视频',
        component: () => import('@renderer/view/video/video.vue')
      },
      // 雷达
      {
        path: '/radar',
        name: '雷达',
        component: () => import('@renderer/view/radar/radar.vue')
      },
      // 喜欢
      {
        path: '/like',
        name: '喜欢',
        component: () => import('@renderer/view/like/like.vue')
      },
      // 最近播放
      {
        path: '/recently',
        name: '最近播放',
        component: () => import('@renderer/view/recently/recently.vue')
      },
      // 搜索
      {
        path: '/search',
        name: '搜索',
        component: () => import('@renderer/view/search/search.vue')
      },
      //播放mv
      {
        path: '/playMv',
        name: '播放mv',
        component: () => import('@renderer/view/playMv/playMv.vue')
      },
      //评论
      {
        path: '/comment',
        name: '评论',
        component: () => import('@renderer/view/comment/index.vue')
      }
    ]
  }
]
export const router = createRouter({
  // 路由模式
  history: createWebHistory(),
  routes
})
